package com.lzs.bootsafety.business.sys.service.impl;

import com.lzs.bootsafety.business.sys.entity.SysDept;
import com.lzs.bootsafety.business.sys.mapper.SysDeptMapper;
import com.lzs.bootsafety.business.sys.service.SysDeptService;
import com.lzs.bootsafety.common.util.DeptTree;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SysDeptServiceImpl implements SysDeptService {
    @Autowired
    private SysDeptMapper sysDeptMapper;
    @Override
    public List<SysDept> getSysDeptList(SysDept sysDept) {
        return sysDeptMapper.selectSysDeptList(sysDept);
    }

    @Override
    public int addDept(SysDept sysDept) {
        return sysDeptMapper.insertSelective(sysDept);
    }

    @Override
    public int updateDept(SysDept sysDept) {
        return sysDeptMapper.updateByPrimaryKeySelective(sysDept);
    }

    @Override
    public SysDept selectDeptBydeptId(Long deptId) {
        return sysDeptMapper.selectByPrimaryKey(deptId);

    }

    @Override
    public int delBydeptId(Long deptId) {
        return sysDeptMapper.deleteByPrimaryKey(deptId);
    }
}
